package com.egghiro.framework.j2se.game.core.timer;

public class STimerContext {

    public long millisTime;
    public long timeSinceLastUpdate;
    public long millisSleepTime;
    public long millisOverSleepTime;

    public STimerContext() {
        millisTime = 0;
        timeSinceLastUpdate = 0;
    }

    public synchronized void setTimeMillis(long millisTime) {
        this.millisTime = millisTime;
    }

    public synchronized long getTimeMillis() {
        return millisTime;
    }

    public synchronized void setTimeSinceLastUpdate(long timeSinceLastUpdate) {
        this.timeSinceLastUpdate = timeSinceLastUpdate;
    }

    public synchronized long getTimeSinceLastUpdate() {
        return timeSinceLastUpdate;
    }

    public long getSleepTimeMicros() {
        return millisSleepTime * 1000;
    }

    public long getSleepTimeMillis() {
        return millisSleepTime;
    }

    public void setSleepTimeMillis(long millisSleepTime) {
        this.millisSleepTime = millisSleepTime;
    }

    public long getOverSleepTimeMillis() {
        return millisOverSleepTime;
    }

    public void setOverSleepTimeMillis(long millisOverSleepTime) {
        this.millisOverSleepTime = millisOverSleepTime;
    }

}
